<?php

use think\migration\Migrator;
use think\migration\db\Column;

class InterfaceBereauToTsinghua extends Migrator
{
    /**
     * 清华接口(气象局的原始数据给清华)
     */
    public function change()
    {
        $table = $this->table('interface_bureau_to_tsinghua');
        $table
            //step1:名称
            ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'comment' => '类型:station_forecast/weather_forecast/pollutant_forecast'])
            ->addColumn('publish_time', 'datetime', ['comment' => '发布时间'])
            //建立域名 tsinghua.sxctkj.cc，将来 xx.xx.xx.xx
            ->addColumn('url', 'string', ['limit' => 100, 'default' => '', 'comment' => '网址'])
            ///json路径目前存放到 /data/jsonfiles/bureau/
            ->addColumn('json_path', 'string', ['limit' => 250, 'default' => '', 'comment' => 'json路径'])
            ->addColumn('json_zip_path', 'string', ['limit' => 250, 'default' => '', 'comment' => 'json压缩成zip的路径方便客户下载'])

            ->addColumn('create_time', 'datetime', ['comment' => '创建时间'])

            //注释
            ->setComment('接口 - 清华接口 - 从气象局获取的原始数据')

            //引擎
            ->setEngine('InnoDB')
            ->save();
    }
}
